package com.bwie.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Auther:${涛}
 * @Date:2024/9/4 19:07
 * @Description: RabbitMq
 * @Version 1.0.0
 */
@Configuration
public class RabbitMq {


    @Bean
    public Queue queue(){
        return new Queue("0904",true);
    }

    @Bean
    public FanoutExchange fanoutExchange(){
        return new FanoutExchange("day0904",true,false);
    }

    @Bean
    public Binding binding(){
        return BindingBuilder.bind(queue()).to(fanoutExchange());
    }
}


